<template>
  <div class="detailContent">
    <div class="movieImg">

      <img :src="require('@/assets/img/'+movie.movieImg)">
    </div>
    <div class="movieInfo">
      <div class="info" style="white-space:pre-wrap; word-wrap:break-word;">
        <span class="block-info">{{movie.movieName}}</span>
        <span class="block-info title">SHE'S GOT NO NAME</span>
        <span class="block-info">中国大陆/96分钟</span>
        <span class="block-info">2025-06-21 09:00中国大陆上映</span>
      </div>
      <div class="buts">
        <button class="btn want-btn">想看</button>
        <button class="btn like-btn">喜欢</button>
        <button class="btn buy-btn" @click="goCinema">购票</button>
      </div>
    </div>
    <div class="movieCore"></div>
  </div>
</template>

<script setup lang="ts">
import Top from "@/components/home/top.vue"
import {router} from "@/router/router.ts"
import require from "@/utils/getFiles";

// 解决查询参数类型问题
// const queryMovie = router.currentRoute.value.query.movie;
// const movie = JSON.parse(queryMovie as string);
const movie = JSON.parse(router.currentRoute.value.query.movie);
//点击跳转影院列表界面
// const goCinema = () => {
//   window.open(router.resolve({path:"/cinemaList", query:{movieId:movie.movieId}}).href)
// }
const goCinema = () => {
  // window.open(router.resolve({path:"/cinemaList", query:{movie:JSON.stringify(movie)}}).href)
  router.push({path:"/cinemaList", query:{"movieId":movie.id}});
}
</script>

<style scoped>
@import "@assets/css/details.css";

</style>